import request from "@/utils/request";

import type { IUser_Info } from "./type";
import type { IResponse } from "@/libcommon";
import type { UserResponse } from "@/libcommon/modules/user";

const enum API {
    getUserInfo = "/users/get",
    UpdateUserInfo = "/users/update",
    updatePassword = "/users/updatepassword",
}

export const GetUserInfoService = async () => {
    return request<any,IResponse>({
        url: API.getUserInfo,
        method: "get",
    })
}

export const UpdateUserInfoService = async (data:IUser_Info) => {
    return request<any,UserResponse>({
        url: API.UpdateUserInfo,
        method: "put",
        data,
    })
}

export const UpdateUserPasswordService = async (data:any) => {
    return request<any,IResponse>({
        url: API.updatePassword,
        method: "put",
        data,
    })
}